﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zmMoniter
{
    public class Point
    {
        public double dX;
        public double dY;
        public Point(double x,double y)
        {
            dX = x;
            dY = y;
        }
        
        public void setX(double x)
        {
            this.dX = x;
        }
        public void setY(double y)
        {
            this.dY = y;
        }
        public void setXY(double x, double y)
        {
            this.dX = x;
            this.dY = y;
        }
        public double getX()
        {
            return this.dX;
        }
        public double getY()
        {
            return this.dY;
        }
        public bool compare(Point pt)
        {
            double dLenth = getLength(pt);
            if (dLenth < 0.001)
            {
                return true;
            }
            return false;
        }
        public double getLength(Point pt)
        {
            return Math.Sqrt((dX - pt.dX) * (dX - pt.dX) + (dY - pt.dY) * (dY - pt.dY));
        }
        public double getLength(double x,double y)
        {
            return Math.Sqrt((dX - x) * (dX - x) + (dY - y) * (dY - y));
        }
    }
   
}
